<?xml version="1.0" encoding="utf-8" ?>
<xs:schema id="Links" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xe="http://www.CrossFactory.net/XmlEditor">
  <xs:complexType name="paragraphs" mixed="false">
    <xs:sequence minOccurs="1" maxOccurs="1">
      <xs:group ref="paragraphsgroup" maxOccurs="unbounded" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>
  
  <xs:simpleType name="imagepos">
    <xs:restriction base="xs:string">
      <xs:enumeration value="left" />
      <xs:enumeration value="right" />
    </xs:restriction>
  </xs:simpleType>
  
  <xs:group name="paragraphsgroup">
    <xs:choice>
      <xs:element name="paragraph" type="paragraph" />
    </xs:choice>
  </xs:group>
  
  <xs:complexType name="paragraph" mixed="true">
    <xs:sequence>
      <xs:element name="tabulation" type="yesno" default="no" maxOccurs="1" minOccurs="1" xe:property="true" />
      <xs:element name="spacing" type="yesno" default="yes" maxOccurs="1" minOccurs="1" xe:property="true" />
      <xs:element name="alignment" type="alignment" default="justify" maxOccurs="1" minOccurs="1" xe:property="true" />
      <xs:element name="data" type="data" maxOccurs="1" minOccurs="1" />
    </xs:sequence>
  </xs:complexType>
  
  <xs:complexType name="data" mixed="true">
    <xs:group ref="paragraphgroup" maxOccurs="unbounded" minOccurs="0" />
  </xs:complexType>
  
  <xs:group name="paragraphgroup">
    <xs:choice>
      <xs:element name="stylerule" type="stylerule" />
      <xs:element name="hyperlink" type="hyperlink" xe:hyperlinkType="www,page" />
    </xs:choice>
  </xs:group>

  <xs:complexType name="stylerule" mixed="true">
    <xs:sequence>
      <xs:element name="rulestyle" type="rulestyle" />
    </xs:sequence>
  </xs:complexType>
  
  <xs:simpleType name="rulestyle">
    <xs:restriction base="xs:string">
      <xs:enumeration value="bold" />
      <xs:enumeration value="italic" />
      <xs:enumeration value="highlight" />
      <xs:enumeration value="important" />
    </xs:restriction>
  </xs:simpleType>
  
  <xs:simpleType name="yesno">
    <xs:restriction base="xs:string">
      <xs:enumeration value="yes" />
      <xs:enumeration value="no" />
    </xs:restriction>
  </xs:simpleType>

  <xs:complexType name="hyperlink" mixed="true">
    <xs:sequence>
      <xs:element name="href" type="text" maxOccurs="1" minOccurs="1" />
      <xs:element name="linkanchor" type="text" minOccurs="1" maxOccurs="1" xe:property="true" />
      <xs:element name="tooltip" type="text" maxOccurs="1" minOccurs="1" />
      <xs:element name="target" type="text" maxOccurs="1" minOccurs="1" />
    </xs:sequence>
  </xs:complexType>


  <xs:simpleType name="alignment">
    <xs:restriction base="xs:string">
      <xs:enumeration value="justify" />
      <xs:enumeration value="left" />
      <xs:enumeration value="right" />
    </xs:restriction>
  </xs:simpleType>
  
  <xs:simpleType name="openin">
    <xs:restriction base="xs:string">
      <xs:enumeration value="_parent" />
      <xs:enumeration value="_blank" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="hpos">
    <xs:restriction base="xs:string">
      <xs:enumeration value="left" />
      <xs:enumeration value="right" />
      <xs:enumeration value="center" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="size">
    <xs:restriction base="xs:string">
      <xs:maxLength value="20" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="text">
    <xs:restriction base="xs:string" />
  </xs:simpleType>
  <xs:simpleType name="empty" final="">
    <xs:restriction base="xs:token"></xs:restriction>
  </xs:simpleType>
  <xs:element name="paragraphs" type="paragraphs"></xs:element>
</xs:schema>